<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class IntegralRecord extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('integral_record',function(Blueprint $table){
            $table->id();
            $table->bigInteger('member_id')->default(0)->comment('用户主键');
            $table->integer('before_integral')->default(0)->comment('变更前积分');
            $table->integer('change_integral')->default(0)->comment('需变更积分');
            $table->integer('after_integral')->default(0)->comment('变更后积分');
            $table->tinyInteger('type')->default(0)->comment('类型:1=增加,2=消耗');
            $table->string('scene_code')->default(0)->comment('场景编码');
            $table->string('scene_event_code')->default(0)->comment('场景事件编码');
            $table->string('scene_price_code')->default(0)->comment('场景奖励编码');
            $table->string('integral_prize_code')->default(0)->comment('积分奖品编码');
            $table->json('prize_json')->comment('奖品信息:JSON');
            $table->json('scene_json')->comment('场景信息:JSON');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
